package com.brayan.webapp.controller.realestate;

import java.util.List;

import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import com.brayan.webapp.service.realestate.CalendarBean;
import com.brayan.webapp.service.realestate.CalendarDay;

@Path("/")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public class CalendarResource {
	
	@Inject
	CalendarBean calService;
	
	public CalendarResource(){
		
	}
 
	/**
	 * Return initial Calendar with Reservations.
	 * @return
	 */
    @GET
    @Path("calendar")
    public List<CalendarDay> getInitialInterval() {
    	// create the first block of days e.g. 28 days
    	List<CalendarDay> listOfCalDays = calService.getCalendarDays(1);    	
    	return listOfCalDays;
    }
 
    @GET
    @Path("calendar/{loadingBlock}")
    public List<CalendarDay> getCalendarDays(@PathParam("loadingBlock") int loadingBlock) {
    	// create the first block of days e.g. 28 days    		
    	List<CalendarDay> listOfCalDays = calService.getCalendarDays(loadingBlock);    	
    	return listOfCalDays;
    }
 
}